package com.tl.boot.entity.role.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.enums.StatusEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * com.tl.boot.entity.role.form -- UpdateRoleInfoForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/19 21:59
 */
public class UpdateRoleInfoForm extends BaseForm {
    @ApiModelProperty( value = "角色ID", name = "roleId", example = "1" )
    private Long roleId;
    @ApiModelProperty( value = "角色编码", name = "roleCode", example = "root" )
    private String roleCode;
    @ApiModelProperty( value = "角色名称", name = "roleName", example = "管理员" )
    private String roleName;
    @ApiModelProperty( value = "角色描述", name = "roleDesc", example = "拥有最高权限的角色" )
    private String roleDesc;
    @ApiModelProperty( value = "角色组", name = "roleGroup", example = "group1" )
    private Long roleGroup;
    @ApiModelProperty( value = "角色状态 VALID INVALID", name = "roleStatusEnum", example = "VALID" )
    private StatusEnum roleStatusEnum;
    @ApiModelProperty( value = "角色内容", name = "roleContent", example = "角色内容" )
    private String roleContent;
    @ApiModelProperty( value = "角色创建人", name = "createUser", example = "张胜男" )
    private String createUser;
    @ApiModelProperty( value = "所属系统编码", name = "belongSysno", example = "sys123" )
    private String belongSysno;
    @ApiModelProperty( value = "所属系统名称", name = "belongSysname", example = "主系统" )
    private String belongSysname;
    @ApiModelProperty( value = "备注", name = "remark", example = "备注信息" )
    private String remark;
    @ApiModelProperty( value = "扩展信息", name = "reserve", example = "扩展信息" )
    private String reserve;


    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleDesc() {
        return roleDesc;
    }

    public void setRoleDesc(String roleDesc) {
        this.roleDesc = roleDesc;
    }

    public Long getRoleGroup() {
        return roleGroup;
    }

    public void setRoleGroup(Long roleGroup) {
        this.roleGroup = roleGroup;
    }

    public StatusEnum getRoleStatusEnum() {
        return roleStatusEnum;
    }

    public void setRoleStatusEnum(StatusEnum roleStatusEnum) {
        this.roleStatusEnum = roleStatusEnum;
    }

    public String getRoleContent() {
        return roleContent;
    }

    public void setRoleContent(String roleContent) {
        this.roleContent = roleContent;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getBelongSysno() {
        return belongSysno;
    }

    public void setBelongSysno(String belongSysno) {
        this.belongSysno = belongSysno;
    }

    public String getBelongSysname() {
        return belongSysname;
    }

    public void setBelongSysname(String belongSysname) {
        this.belongSysname = belongSysname;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getReserve() {
        return reserve;
    }

    public void setReserve(String reserve) {
        this.reserve = reserve;
    }

    @Override
    public void checkParam() {
        if (this.getRoleId() == null
                || StringUtils.isBlank(this.getRoleName())
                || StringUtils.isBlank(this.getRoleCode())) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
